Like in other object oriented languages class types can be abstract. This property is defined by the keyword abstract in the class type declaration.

An abstract class type doesn't need to implement any of the methods which are declared in the interface. That is why abstract class types can't be instantiated.

Abstract classes are mostly used to define a common interface for a class hierarchy. This technique is often used with polymorphism (see Chapter 5.3).

Inheritance with class types is restricted only to single inheritance. That means a derived class can inherit only from one parent. Multiple inheritance raises a lot of problems and can often be emulated by other object oriented techniques like delegation to an aggregated object.


A short summary of inheritance for class types

  • All declarations of a class type which are made in the class type interface will be inherited to child classes.
  • Private declarations are not visible in derived classes.
  • Items hidden by redefinition can be accessed by a qualified notation.
  • Inherited methods always use the inherited attributes, even if an additional attribute is declared with the same name.
  • Class Types can be defined as abstract classes.
  • Abstract classes can't be instantiated.
  • Only single inheritance is supported for class types.